<template>
    <div style="height: 44px;">
        <m-form
                v-for="(item,index) in fieldList"
                :key="index"
                :field="item"
                @change="onChange"
                :value="value[item.field_id]"
        >
            <div slot="label">hhhh</div>
            <div slot="value">hhhh</div>
        </m-form>
    </div>
</template>

<script>
  import form from '../form'
  export default {
    name: "formDemo",
    components: {
      "m-form": form
    },
    data(){
      return {
        fieldList: [
          {
            label: '文本输入',
            type: 'text',
            placeholder: '文本',
            defaultValue: 'hhh',
            disabled:true
          },
          {
            label: '密码输入',
            type: 'password',
            placeholder: '密码',
            defaultValue: '789456123',
            disabled:true
          },
          {
            label: '单选列表',
            type: 'picklist',
            placeholder: '选择',
            options: [
              'okok',
              'ab',
              'cd',
              'ef',
              'gh',
              'ij',
              'kl',
              'mn',
              'op',
              'qr',
              'st',
            ],
            defaultValue: 'ab',
            disabled:false
          },
          {
            // label: '上传图片',
            type: 'picture',
            disabled:false
          },
          {
            label: '性别',
              type: 'radio',
            defaultValue: '男',
            options: [
            {name: '男',id: '男'},
            {name: '女',id: '女'}
          ]
          },

        ],
        value: {}
      }
    },
    methods: {
      onChange(e){
        console.log(e);
      }
    },
  }
</script>

<style scoped lang="less">

</style>
